<template>
    <div class="store-detail-title">
        <div class="bg-image" :style="{background: 'url(' + (this.image_path ? pre + this.image_path : '') + ') no-repeat center/cover'}"></div>
        <div class="detail-title-top">
            <!-- 左侧商铺图片 -->
            <van-image width="90" height="90" radius="10" fit="cover" :src="(image_path) ? pre + image_path : ''" />
            <!-- 商铺详情 -->
            <div class="store-detail-desc">
                <h3>{{name}}</h3>
                <div> {{supports? supports[0].name : ''}} / {{supports? supports[1].name : ''}} / {{piecewise_agent_fee ? piecewise_agent_fee.tips : ''}}</div>
                <div>{{description}}</div>
            </div>

            <!-- 右侧更多 -->
            <div class="store-detail-more"><router-link to="/"><van-icon name="arrow" /></router-link></div>
        </div>
        <div class="detail-title-bottom">
            <div class="title-bottom-l">
                <ul>
                    <li v-for="content in activities" :key="content.id">
                        <span class="activities-substruct" :style="{backgroundColor: '#' + content.icon_color}">{{content.icon_name}}</span>
                        <span>{{content.description}}</span>
                    </li>
                </ul>
            </div>
            <div class="title-bottom-r">
                <router-link to="/"><span>{{activities?activities.length: 0}}个活动</span> <van-icon name="arrow" /></router-link>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return {
            pre: "http://kumanxuan1.f3322.net:8001/img/"
        }
    },
    props: ['image_path','piecewise_agent_fee','supports','name', 'description', 'activities']
}
</script>

<style lang="less" scoped>
    .store-detail-title{
        position: relative;
        box-sizing: border-box;
        width: 100%;
        padding: 15px 10px 15px 15px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background-color: rgb(212, 220, 243);
        z-index: 1;

        .bg-image{
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgb(236, 237, 240);
            opacity: 0.6;
            -webkit-filter: blur(10px); /* Chrome, Opera */
            -moz-filter: blur(10px);
            -ms-filter: blur(10px);    
                filter: blur(10px);
            z-index: -1;
        }


        // 详情页头部
        .detail-title-top{
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            font-size: 28px;
            color: #fff;
            
            // 商铺描述
            .store-detail-desc{
                padding-left: 20px;
                box-sizing: border-box;
                display: flex;
                flex-direction: column;
                justify-content: space-around;

                h3{
                    margin: 0;
                    font-size: 40px;
                }
            }

            .store-detail-more{
                flex: 1;
                display: flex;
                flex-direction: row;
                justify-content: flex-end;
                align-items: center;
                font-size: 40px;
                a{
                     color: #fff;
                }
            }
        }

        // 详情页下半部
        .detail-title-bottom{
            margin-top: 12px;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }

        // 活动
        .activities-substruct{
            display: inline-block;
            background-color: #ee7475;
            color: #fff;
            height: 30px;
            width: 30px;
            line-height: 30px;
            text-align: center;
            padding: 3px;
            border-radius: 5px;
        }

        .title-bottom-l{
            color: #fff;
            li{
                padding-top: 10px;
            }
            li span:nth-child(2){
                padding-left: 20px;
            }
        }

        .title-bottom-r a{
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            align-items: center;
            color: #fff;
        }

    }
</style>